package com.situ.water_user.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.situ.water_user.pojo.UsUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@Mapper
@Repository
public interface UsUserMapper extends BaseMapper<UsUser> {
    IPage<UsUser> selectbylwt(@Param("page") Page<UsUser> page,@Param("user") UsUser user);

    void update(UsUser usUser);

    List<Map> selectuser();

    Integer selectusercount();

    IPage<Map> metervalue(@Param("page") Page<Map> page,@Param("month") Date month);


    // List<Map> selectlwt(Page<UsUser> page, UsUser user);

    @Select("select max(UserNo) from US_User")
    public Integer userID();

    @Select("select * from Us_user where userNo=#{value}")
    public UsUser queryByUserNo(String userNo);

    //快捷过户
    @Update("update us_user set userName=#{userName},phone=#{phone},smsPhone=#{smsPhone},address=#{address} where userNo=#{userNo}")
    public void ghUser(UsUser user);

    //快捷代扣
    @Update("update us_user set payType=#{payType},bankName=#{bankName},bankNum=#{bankNum} where userNo=#{userNo}")
    public void dkUser(UsUser user);

    //快捷重签
    @Update("update us_user set formula=#{formula} where userNo=#{userNo}")
    public void cqUser(UsUser user);

    //快捷销户
    @Update("update us_user set disabled=#{disabled},remarks=#{remarks} where userNo=#{userNo}")
    public void xhUser(UsUser user);

    //档案号管理
    @Update("update us_user set docNum=#{docNum} where userNO=#{userNo}")
    public void dahUser(UsUser user);


}
